package com.example.controller;


import com.example.service.WebNcService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/Web")
public class WebNcController {

    @Resource
    private WebNcService webNcService;


    @GetMapping("/getDataByCdnId/{cdnId}")
    @ResponseBody
    public List getDataByCdnId(@PathVariable(name ="cdnId",required = false)String cdnId){
        try {
            List data = webNcService.getDataByCdnId(cdnId);
            System.out.println(data);
            return data;
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }

    }
}
